-
Notifications
You must be signed in to change notification settings - Fork 582
Add Conformance tests for BackendTLSPolicy validating SANs with Type dsnName #3983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hi @kl52752. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kl52752!
|
||
// Verify that request sent to Service targeted by BackendTLSPolicy with mismatched SAN should failed. | ||
t.Run("HTTP request send to Service targeted by BackendTLSPolicy with mismatched SAN should return HTTP error", func(t *testing.T) { | ||
h.MakeRequestAndExpectFailure(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this will pass if any non-200 error code is returned. Can we be more specific here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the spec is a bit vague here, error codes are not constrained but it is up to implementation how to signal the error
subjectAltNames: | ||
- type: Hostname | ||
hostname: abc.example.com | ||
hostname: "mismatch.example.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it's testing a config mismatch instead of a mismatch in the cert itself. Can we also include a test that covers a case where the config lines up but the cert served by the backend does not match either the configured hostname or the SANs?
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kl52752 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve run the tests with the airlock-microgateway implementation, all of them passed.
- type: Hostname | ||
hostname: efg.example.com | ||
- type: Hostname | ||
hostname: yjh.example.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you also plan to add some test with SAN type URI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but I wanted to do this in next PR, because there will be more changes related to certificate creation.
What type of PR is this?
/kind test
What this PR does / why we need it:
Add Conformance tests for BackendTLSPolicy validating SANs set with Type dns name
Which issue(s) this PR fixes:
Relates to #3979
Does this PR introduce a user-facing change?: